package com.axjy.service.impl;

import com.axjy.dao.RoomsMapper;
import com.axjy.dto.RoomsDto;
import com.axjy.service.RoomsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import javax.annotation.Resource;

/**
 * Created by LXShuai on 2018/1/31.
 */
@Service("roomsService")
@Transactional
public class RoomsServiceImpl implements RoomsService {
    @Resource
    private RoomsMapper roomsMapper;
    @Override
    @Transactional(readOnly = true)
    public Pager searchPager(Integer offset, Integer limit, RoomsDto dto) {
        Pager pager = new Pager();
        pager.setRows(roomsMapper.findRows(offset,limit,dto));
        pager.setTotal(roomsMapper.findTotal(dto));
        return pager;
    }
}
